// eslint-disable-next-line no-undef
const { compressionWebpackPlugin } = require("./compression.js");
// eslint-disable-next-line no-undef
const { terserPlugin } = require("./terser.js");
// eslint-disable-next-line no-undef
module.exports = {
  chainWebpackPlugins: env => {
    const { VUE_BUILD_COMPRESS, NODE_ENV } = env;
    let plugins = [];
    VUE_BUILD_COMPRESS && plugins.push(compressionWebpackPlugin());
    NODE_ENV === "production" && plugins.push(terserPlugin());
    return plugins;
  }
};
